<!DOCTYPE html>
<html>

<head>
    <include file="public@head" title="{$cate.name}" keywords="{$cate.keywords}" description="{$cate.description}"/>
</head>

<body>

<include file="public@header"/>

<div class="page-header">
    <div class="layui-container">
        <div class="page-header-area">
            <h1 class="page-header-title">{$cate.name}</h1>
        </div>
    </div>
</div>
<div class="layui-container">
    <hr class="bg-transparent"/>
    <p class="layui-breadcrumb">
        <a href="/">首页</a>
        <a href="{:url('index/list/index',array('id'=>$cate.id))}">{$cate.name}</a>
        <a><cite>列表</cite></a>
    </p>
    <hr class="bg-transparent"/>
</div>
<div class="layui-container">
    <div class="layui-row layui-col-space10" id="articles">
        <foreach name="articles" item="vo">
            <div class="layui-col-md6">
                <article id="{$vo.id}" class="card">
                    <div class="post-head">
                        <h2 class="post-title">
                            <a href="{$vo.link}" target="_blank" title="{$vo.excerpt}">{$vo.title}</a>
                        </h2>
                        <div class="post-meta">
                            <span class="author">作者：<a href="http://www.zzuyxg.top">Eric</a></span> •
                            <time class="post-date" datetime="{$vo.create_time}" title="{$vo.create_time}">
                                {$vo.create_time}
                            </time>
                        </div>
                    </div>
                    <div class="post-excerpt">
                        <p>{$vo.excerpt}</p>
                    </div>
                    <div class="post-footer">
                        <div class="pull-right">
                            <a href="{$vo.link}" target="_blank" title="{$vo.excerpt}"
                               class="layui-btn layui-btn-primary">阅读全文</a>
                        </div>
                    </div>
                </article>
            </div>
        </foreach>
    </div>
</div>
<include file="public@footer"/>
<script>
    layui.use(['element', 'flow', 'jquery'], function () {
        var flow = layui.flow, element = layui.element,
            $ = layui.jquery;

        flow.load({
            elem: '#articles',
            isAuto: false,
            end: '内容已加载完',
            done: function (page, next) {
                var lis = [];
                $.get("{:url('list/get_article_flow')}?id={$cate.id}&page=" + page, function (res) {
                    layui.each(res.data, function (index, item) {
                        var html = '<article id="' + item.id + '" class="card">';
                        html += '<div class="post-head"><h2 class="post-title"><a href="' + item.link + '" target="_blank" title="' + item.title + '">' + item.title + '</a></h2>';
                        html += '<div class="post-meta"><span class="author">作者：<a href="http://www.zzuyxg.top">Eric</a></span> •<time class="post-date" datetime="' + item.create_time + '" title="' + item.create_time + '">' + item.create_time + '</time></div></div>';
                        html += '<div class="post-excerpt"><p>' + item.excerpt + '</p></div>';
                        html += '<div class="post-footer"><div class="pull-right"><a href="' + item.link + '" target="_blank" title="' + item.title + '" class="layui-btn layui-btn-primary">阅读全文</a></div></div>';
                        html += '</article>';
                        lis.push(html);
                    });
                    next(lis.join(''), page < res.pages);
                });
            }
        });
    });
</script>
</body>

</html>
